using System.Collections.Generic;
using System.Threading.Tasks;
using NBModular.Lib.Data.Abstractions;
using NBModular.Module.WeChat.Domain.WeChat.Models;
using NBModular.Lib.WeChat.Core.Auth.Models;

namespace NBModular.Module.WeChat.Domain.WeChat
{
    /// <summary>
    /// 微信配置管理仓储
    /// </summary>
    public interface IWeChatRepository : IRepository<WeChatEntity>
    {
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<IList<WeChatEntity>> Query(WeChatQueryModel model);

        /// <summary>
        /// 获取GLOBAL_ACCESS_TOKEN
        /// </summary>
        /// <param name="appid"></param>
        /// <returns></returns>
        Task<string> GetTokenAsync(string appid);

        /// <summary>
        /// 获取微信用户信息
        /// </summary>
        /// <param name="appid"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<string> GetUserInfoAsync(string appid, string code);

        /// <summary>
        /// 获取JSAPI-Ticket
        /// </summary>
        /// <param name="appid"></param>
        /// <param name="access_token"></param>
        /// <returns></returns>
        Task<string> GetTicketAsync(string appid, string access_token);

        /// <summary>
        /// 获取微信JS-SKD配置
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="jsapi_ticket"></param>
        /// <param name="url"></param>
        /// <returns></returns>
        Task<WxConfigModel> GetWxConfigAsync(string appId, string jsapi_ticket, string url);
    }
}
